/**
 * @filename:${serviceName} ${createTime}
 * @project ${project}  ${version}
 * Copyright(c) 2020 ${author} Co. Ltd. 
 * All right reserved. 
 */
package ${serviceUrl};

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

<#list pkgs as ps>
	<#if ps??>
import ${ps};
	</#if>
</#list>

/**   
 * @Description: ${entityComment}Service层
 * 
 * @version: ${version}
 * @author: ${author}
 * 
 */
@Service
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class ${serviceName} {
	@Autowired
	${mapperName} mapper;

	// add
	public void insert(${entityName} obj) { mapper.insert(obj);}
	// delete
	public void delete(${primaryKeyType} id) { mapper.deleteByPrimaryKey(id); }
	// update
	public void update(${entityName} obj) { mapper.updateByPrimaryKeySelective(obj); }
	// select one
	public ${entityName} selectById(${primaryKeyType} id) { return mapper.selectByPrimaryKey(id); }
	// select many
	public List<${entityName}> getList(Map<#noparse><String,Object></#noparse> filter) { return mapper.getList(filter); }
	// count
	public int count(Map<String, Object> filter) { return mapper.count(filter); }

	// ***********


}
	